Python Installation


In this section we are goind to discuss about various options available in which python can be installed.

Selecting Python Distributions

Before we install python we need to explore the reasons due to which we need to install python. The reason for doing that is if we know exactly for what reason we are installing/learning python then it will be easy to select the appropriate python distribution.

Lets discuss the most common reasons for which we might wish to learn python, you might have altogether new reason. if so please inform me and I will add it here.

  1. Part of curriculum in school/collage
  2. System programming
  3. Web development
  4. Desktop application development
  5. Machine Learning
  6. Automation

If one wishes to have most of the packages preinstalled then can select any distribution from the below list except from python.org.

Based on the above requirement you might wish to select appropriate python distribution for the listed distribution below.

Usually I prefer to install python from python.org and later add required modules using pip command, but its your choice and need.

NOTE Currently we are not covering alternative python implementations such as

Python Environment Variables


If python is installed from source then the following env variables will not be populated and can be updated manually.

  • PYTHONPATH: It has a role similar to PATH. This variable tells the Python interpreter where to locate the module files imported into a program. It should include the Python source library directory and the directories containing Python source code. PYTHONPATH is sometimes preset by the Python installer.
  • PYTHONSTARTUP: It contains the path of an initialization file containing Python source code. It is executed every time you start the interpreter. It is named as .pythonrc.py in Unix and it contains commands that load utilities or modify PYTHONPATH.
  • PYTHONCASEOK: It is used in Windows to instruct Python to find the first case-insensitive match in an import statement. Set this variable to any value to activate it.
  • PYTHONHOME: It is an alternative module search path. It is usually embedded in the PYTHONSTARTUP or PYTHONPATH directories to make switching module libraries easy.